/*------------------------------------------------------------------------------
 * @FILE    MQTT.H
 * @AUTHOR  GUOKEKE
 * @DATE    2024/12/21 17:32:04
 * @VERSION  V1.0
/* ------------------------------------------------------------------------------*/

#ifndef __MQTT_H__
#define __MQTT_H__

#ifdef __cplusplus
#if __cplusplus
extern "C"
{
#endif
#endif /* __cplusplus */

	enum iot_ctrl_status_t
	{
		IOT_STATUS_LOGIN,
		IOT_STATUS_CONNECT,
		IOT_STATUS_DROP,
	};

	typedef void (*pMessageArrived_Fun)(void *, int len);

	void mqtt_module_init(void);
	int mqtt_data_write(char *pbuf, int len, char retain);

	void mqtt_data_rx_cb2(void *pbuf, int len);
	void *cloud_mqtt_thread(void *arg);

#define mDEBUG(fmt, ...) printf("%s[%s](%d):" fmt, __FILE__, __FUNCTION__, __LINE__, ##__VA_ARGS__)

#ifdef __cplusplus
#if __cplusplus
}
#endif
#endif /* __cplusplus */
#endif /* __MQTT_H__ */
